package com.example.smartwaterapi.controller;

import com.example.smartwaterapi.common.api.RestApiResponse;
import com.example.smartwaterapi.entity.PomodoroClock;
import com.example.smartwaterapi.service.PomodoroClockService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 番茄闹钟控制器
 */
@Tag(name = "番茄闹钟管理API", description = "番茄闹钟相关接口")
@RestController
@RequestMapping("/api/pomodoro-clock")
public class PomodoroClockController {

    @Autowired
    private PomodoroClockService pomodoroClockService;

    @Operation(summary = "获取番茄闹钟详情", description = "根据ID获取番茄闹钟信息")
    @GetMapping("/{id}")
    public RestApiResponse<PomodoroClock> getPomodoroClock(@Parameter(description = "ID") @PathVariable Long id) {
        PomodoroClock clock = pomodoroClockService.getById(id);
        if (clock == null) {
            return RestApiResponse.notFound("番茄闹钟记录不存在");
        }
        return RestApiResponse.ok(clock);
    }

    // Add more endpoints

} 